package com.hzy.friend.api;

import com.hzy.friend.entity.User;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
* 请替换User介绍 api
*
* @author: 请替换作者
* @version: 1.0
* @datetime: 2019-03-01 17:33:27
*/
public interface UserApi {
    /**
     * 保存
     * @param user
     * @return
     */
    @RequestMapping(value = "/remote/user/save",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    void save(@RequestBody User user) throws Exception;

    /**
     * 修改
     * @param user
     * @return
     */
    @RequestMapping(value = "/remote/user/modify",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    void modify(@RequestBody User user) throws Exception;

    /**
     * 删除
     * @param user
     * @return
     */
    @RequestMapping(value = "/remote/user/remove",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    void remove(@RequestBody User user) throws Exception;

    /**
     * 排序
     * @param user
     * @return
     */
    @RequestMapping(value = "/remote/user/resort",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    void resort(@RequestBody User user) throws Exception;

    /**
     * 根据主键查询id
     * @param user
     * @return
     */
    @RequestMapping(value = "/remote/user/findById",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    User findById(@RequestBody User user) throws Exception;

    /**
    * 查询 -- 不分页
    * @return
    */
    @RequestMapping(value = "/remote/user/find",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    List<User> find(@RequestBody User user) throws Exception;
}